package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.PersonalEventEnum;

import java.util.Date;
import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.PersonalEventExample.E_ATTACH_URL;
import static org.jsola.hr.example.PersonalEventExample.E_COMPANY_ID;
import static org.jsola.hr.example.PersonalEventExample.E_COMPANY_NAME;
import static org.jsola.hr.example.PersonalEventExample.E_DESCRIPTION;
import static org.jsola.hr.example.PersonalEventExample.E_EMP_ID;
import static org.jsola.hr.example.PersonalEventExample.E_EVENT_NAME;
import static org.jsola.hr.example.PersonalEventExample.E_EVENT_TIME;
import static org.jsola.hr.example.PersonalEventExample.E_EVENT_TYPE;
import static org.jsola.hr.example.PersonalEventExample.E_IF_AUTO;
import static org.jsola.hr.example.PersonalEventExample.E_USER_ID;
import static org.jsola.hr.example.PersonalEventExample.M_ATTACH_URL_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_COMPANY_NAME_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_DESCRIPTION_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_DESCRIPTION_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_EMP_ID_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_EMP_ID_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_NAME_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_NAME_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_TIME_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_TYPE_MAX;
import static org.jsola.hr.example.PersonalEventExample.M_EVENT_TYPE_NOT_NULL;
import static org.jsola.hr.example.PersonalEventExample.M_USER_ID_MAX;
import static org.jsola.hr.example.PersonalEventExample.N_ATTACH_URL;
import static org.jsola.hr.example.PersonalEventExample.N_COMPANY_ID;
import static org.jsola.hr.example.PersonalEventExample.N_COMPANY_NAME;
import static org.jsola.hr.example.PersonalEventExample.N_DESCRIPTION;
import static org.jsola.hr.example.PersonalEventExample.N_EMP_ID;
import static org.jsola.hr.example.PersonalEventExample.N_EVENT_NAME;
import static org.jsola.hr.example.PersonalEventExample.N_EVENT_TIME;
import static org.jsola.hr.example.PersonalEventExample.N_EVENT_TYPE;
import static org.jsola.hr.example.PersonalEventExample.N_IF_AUTO;
import static org.jsola.hr.example.PersonalEventExample.N_USER_ID;

/**
 * 人事变动表
 *
 * @author ds
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【人事变动表】的参数")
@Data
public class PersonalEventAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_USER_ID, example = E_USER_ID)
    @Length(max = 32, message = M_USER_ID_MAX)
    private String userId;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_IF_AUTO, example = E_IF_AUTO)
    private Boolean ifAuto;

    @ApiModelProperty(notes = N_EVENT_NAME, example = E_EVENT_NAME, required = true)
    @NotNull(message = M_EVENT_NAME_NOT_NULL)
    @Length(max = 100, message = M_EVENT_NAME_MAX)
    private String eventName;

    @ApiModelProperty(notes = N_EVENT_TYPE, example = E_EVENT_TYPE, required = true, allowableValues = PersonalEventEnum.VALUES_STR)
    @NotNull(message = M_EVENT_TYPE_NOT_NULL)
    @Length(max = 50, message = M_EVENT_TYPE_MAX)
    @Const(constClass = PersonalEventEnum.class, message = M_EVENT_TYPE_ENUM_NOT_MATCH)
    private String eventType;

    @ApiModelProperty(notes = N_COMPANY_NAME, example = E_COMPANY_NAME)
    @Length(max = 100, message = M_COMPANY_NAME_MAX)
    private String companyName;

    @ApiModelProperty(notes = N_DESCRIPTION, example = E_DESCRIPTION, required = true)
    @NotNull(message = M_DESCRIPTION_NOT_NULL)
    @Length(max = 255, message = M_DESCRIPTION_MAX)
    private String description;

    @ApiModelProperty(notes = N_EVENT_TIME, example = E_EVENT_TIME, required = true)
    @NotNull(message = M_EVENT_TIME_NOT_NULL)
    private Date eventTime;

    @ApiModelProperty(notes = N_ATTACH_URL, example = E_ATTACH_URL)
    @Length(max = 3000, message = M_ATTACH_URL_MAX)
    private String attachUrl;

    @ApiModelProperty(notes = N_EMP_ID, example = E_EMP_ID, required = true)
    @NotNull(message = M_EMP_ID_NOT_NULL)
    @Length(max = 32, message = M_EMP_ID_MAX)
    private String empId;


}

